﻿Public Class Hanghoa

    Private Sub KeToanTienMat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Cursor = Cursors.WaitCursor
        'TODO: This line of code loads data into the 'ErpharmaDataSet.dmtinhtrang' table. You can move, or remove it, as needed.
        Me.DmtinhtrangTableAdapter.Fill(Me.ErpharmaDataSet.dmtinhtrang)
        'TODO: This line of code loads data into the 'ErpharmaDataSet.dmhanghoa_hoatchat' table. You can move, or remove it, as needed.
        Me.Dmhanghoa_hoatchatTableAdapter.Fill(Me.ErpharmaDataSet.dmhanghoa_hoatchat)
        'TODO: This line of code loads data into the 'ErpharmaDataSet.dmhanghoa_donvitinh' table. You can move, or remove it, as needed.
        Me.Dmhanghoa_donvitinhTableAdapter.Fill(Me.ErpharmaDataSet.dmhanghoa_donvitinh)
        'TODO: This line of code loads data into the 'ErpharmaDataSet.dmhanghoa' table. You can move, or remove it, as needed.
        Me.DmhanghoaTableAdapter.Fill(Me.ErpharmaDataSet.dmhanghoa)
        Me.DmthoigianIUltraCombo.setDataTable(Me.ErpharmaDataSet.dmthoigian) 'iultracombo

        'set doi tuong cho ultragrid
        Me.DmhanghoaIUltraGrid_DanhSach.setDoiTuongXuLyDuLieu(Me.ErpharmaDataSet.dmhanghoa, Me.DmhanghoaBindingSource, Me.DmhanghoaTableAdapter, Me.ErpharmaDataSet)
        Me.DmhanghoaIUltraGrid_ThongTin.setDoiTuongXuLyDuLieu(Me.ErpharmaDataSet.dmhanghoa, Me.DmhanghoaBindingSource, Me.DmhanghoaTableAdapter, Me.ErpharmaDataSet)
        Me.Dmhanghoa_donvitinhIUltraGrid.setDoiTuongXuLyDuLieu(Me.ErpharmaDataSet.dmhanghoa_donvitinh, Me.Dmhanghoa_donvitinhBindingSource, Me.Dmhanghoa_donvitinhTableAdapter, Me.ErpharmaDataSet)
        Me.Dmhanghoa_hoatchatIUltraGrid.setDoiTuongXuLyDuLieu(Me.ErpharmaDataSet.dmhanghoa_hoatchat, Me.Dmhanghoa_hoatchatBindingSource, Me.Dmhanghoa_hoatchatTableAdapter, Me.ErpharmaDataSet)

        'set giao dien
        Me.Dmhanghoa_donvitinhIUltraGrid.setGiaoDienTuyBien()
        Me.Dmhanghoa_hoatchatIUltraGrid.setGiaoDienTuyBien()
        Me.DmhanghoaIUltraGrid_DanhSach.setGiaoDienTuDong()
        Me.DmthoigianIUltraCombo.setGiaoDien()
        Me.DmtinhtrangIUltraDropDown.setGiaoDien()

        'set tìm kiếm
        Me.DmhanghoaIUltraGrid_DanhSach.setTimKiemTrenCotUltraGrid()
        Me.Dmhanghoa_donvitinh_TimKiem_IUltraGrid.setTimKiemTrenCotUltraGrid()
        Me.Dmhanghoa_hoatchat_TimKiem_IUltraGrid.setTimKiemTrenCotUltraGrid()

        'set group by - iultragrid timkiem
        Me.Dmhanghoa_donvitinh_TimKiem_IUltraGrid.setGroupBy("ma")
        Me.Dmhanghoa_hoatchat_TimKiem_IUltraGrid.setGroupBy("ma")

        'set menustrip
        Me.Dmhanghoa_donvitinhIUltraGrid.setChoPhepMenuStrip()
        Me.Dmhanghoa_hoatchatIUltraGrid.setChoPhepMenuStrip()
        Me.DmhanghoaIUltraGrid_DanhSach.setThemIUltraDropDown(Me.DmtinhtrangIUltraDropDown, Me.ErpharmaDataSet.dmtinhtrang)
        Me.DmhanghoaIUltraGrid_ThongTin.setThemIUltraDropDown(Me.DmtinhtrangIUltraDropDown, Me.ErpharmaDataSet.dmtinhtrang)
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub btnTaoMoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTaoMoi.Click

        Me.DmhanghoaIUltraGrid_ThongTin.getTaoMoi()
    End Sub

    Private Sub btnLuu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLuu.Click
        If Me.DmhanghoaIUltraGrid_ThongTin.getLuu() Then
        End If
    End Sub

    Private Sub btnXoa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXoa.Click
        Me.DmhanghoaIUltraGrid_ThongTin.getXoa()
    End Sub

    Private Sub btnLamTuoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLamTuoi.Click
        Me.DmhanghoaIUltraGrid_ThongTin.getRefresh()
    End Sub

    Private Sub btnIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIn.Click

    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Dispose()
        Me.Close()
    End Sub


    Private Sub Ketoantienmatchitiet_ThongTinChinh_TimKiem_IUltraGrid_ClickCell(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ClickCellEventArgs) Handles Dmhanghoa_donvitinh_TimKiem_IUltraGrid.ClickCell
        If Me.Dmhanghoa_donvitinh_TimKiem_IUltraGrid.ActiveRow.Index <> -1 Then
            Try
                Me.DmhanghoaBindingSource.Position = Me.DmhanghoaBindingSource.Find("ma", Me.Dmhanghoa_donvitinh_TimKiem_IUltraGrid.ActiveRow.Cells("ma").Value)

            Catch ex As Exception
            End Try
        End If
    End Sub

    Private Sub KetoantienmatIUltraGrid_ThongTin_BeforeCellDeactivate(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles DmhanghoaIUltraGrid_ThongTin.BeforeCellDeactivate
        Me.DmhanghoaIUltraGrid_ThongTin.setFocusCellUltraGrid(Me.Dmhanghoa_donvitinhIUltraGrid)

    End Sub
    

End Class